package com.youtellv1.service.Impl;

import com.youtellv1.entity.Admin;
import com.youtellv1.mapper.AdminMapper;
import com.youtellv1.service.AdminService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminServiceImpl implements AdminService {
    @Resource
    private AdminMapper adminMapper;

    @Override
    public List<Admin> findAllService() {
        return adminMapper.findAllAdmin();
    }

    @Override
    public Admin findAllService(Admin admin) {
        return adminMapper.findAdminById(admin);
    }

    @Override
    public void saveService(Admin admin) {
        adminMapper.save(admin);
    }

    @Override
    public void updateService(Admin admin) {
        adminMapper.update(admin);
    }

    @Override
    public void deleteService(Admin admin) {
        adminMapper.delete(admin);
    }

    @Override
    public Admin findByAccountAndPassword(Admin admin) {
        return adminMapper.findByAccountAndPassword(admin);
    }

    @Override
    public Admin findByAccount(Admin admin) {
        return adminMapper.findByAccount(admin);
    }

    @Override
    public Admin findByPassword(Admin admin) {
        return adminMapper.findByPassword(admin);
    }
}
